package cn.itlaobing.service;

import cn.itlaobing.dao.TrainDao;
import cn.itlaobing.exception.BusinessException;

import java.sql.SQLException;
import java.util.Map;

/**
 * @Description:
 * @Author: WangDong
 * @Date: 2017/11/9 21:45
 */
public class TrainService {

    public Map<String,Object> queryByTrainNum(String trainNum, String startStation, String endStation) throws BusinessException {
        Map<String,Object> map=null;
        TrainDao trainDao=new TrainDao();
        try {
            map=trainDao.queryByTrainNumAndStation(trainNum,startStation,endStation);

        } catch (SQLException e) {
            e.printStackTrace();
            throw new BusinessException(e.getMessage());
        }
        return map;
    }
}
